package com.top10.service.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.top10.entity.Address;
import com.top10.mapper.AddressMapper;
import com.top10.service.AddressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AddressServiceImpl implements AddressService{
    @Autowired
    private AddressMapper addressMapper;

    @Override
    public Integer getParent()throws Exception{
        return addressMapper.getParent();
    }

    @Override
    public List<Address> getParents(Integer id)throws Exception{
        return addressMapper.selectList(new EntityWrapper<Address>().eq("parent_id",id));
    }
    @Override
    public Address selectByFullName(String merger_name)throws Exception{
        return addressMapper.selectByFullName(merger_name);
    }
}
